package com.netease.nie.dto;

import java.util.HashMap;
import java.util.Map;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.netease.nie.base.utils.JsonUtils;

/**
 * 订单日志记录Dto
 * @author linzijie
 * @CreateDate Jan 4, 2017
 */
public class OrdersLogDto {
	
	@JSONField(name = "user_id")
	private Long userId;
	
	@JSONField(name = "goods_id")
	private Long goodsId;
	
	@JSONField(name = "goods_title")
	private String goodsTitle;
	
	@JSONField(name = "custom_goods_id")
	private Integer customGoodsId;
	
	@JSONField(name = "exchange_code_id")
	private Integer exchangeCodeId;

	@JSONField(name = "goods_type")
	private Integer goodsType;
	
	@JSONField(name = "price")
	private Integer price;

	@JSONField(name = "serial_number")
	private String serialNumber;
	
	@JSONField(name = "generate_date")
	private Integer generateDate;
	
	@JSONField(name = "create_time")
	private Long createTime;
	
	@JSONField(name = "exchange_status")
	private String exchangeStatus;
	
	public Long getUserId() {
		return userId;
	}
	
	@JsonProperty("user_id")
	public void setUserId(Long userId) {
		this.userId = userId;
	}
	
	public Long getGoodsId() {
		return goodsId;
	}
	
	@JsonProperty("goods_id")
	public void setGoodsId(Long goodsId) {
		this.goodsId = goodsId;
	}
	
	public String getGoodsTitle() {
		return goodsTitle;
	}

	@JsonProperty("goods_title")
	public void setGoodsTitle(String goodsTitle) {
		this.goodsTitle = goodsTitle;
	}

	public Integer getCustomGoodsId() {
		return customGoodsId;
	}
	
	@JsonProperty("custom_goods_id")
	public void setCustomGoodsId(Integer customGoodsId) {
		this.customGoodsId = customGoodsId;
	}
	
	public Integer getExchangeCodeId() {
		return exchangeCodeId;
	}

	@JsonProperty("exchange_code_id")
	public void setExchangeCodeId(Integer exchangeCodeId) {
		this.exchangeCodeId = exchangeCodeId;
	}

	public Integer getGoodsType() {
		return goodsType;
	}

	@JsonProperty("goods_type")
	public void setGoodsType(Integer goodsType) {
		this.goodsType = goodsType;
	}

	public Integer getPrice() {
		return price;
	}

	@JsonProperty("price")
	public void setPrice(Integer price) {
		this.price = price;
	}

	public String getSerialNumber() {
		return serialNumber;
	}

	@JsonProperty("serial_number")
	public void setSerialNumber(String serialNumber) {
		this.serialNumber = serialNumber;
	}

	public Integer getGenerateDate() {
		return generateDate;
	}

	@JsonProperty("generate_date")
	public void setGenerateDate(Integer generateDate) {
		this.generateDate = generateDate;
	}
	
	public Long getCreateTime() {
		return createTime;
	}
	
	@JsonProperty("create_time")
	public void setCreateTime(Long createTime) {
		this.createTime = createTime;
	}
	
	public String getExchangeStatus() {
		return exchangeStatus;
	}

	@JsonProperty("exchange_status")
	public void setExchangeStatus(String exchangeStatus) {
		this.exchangeStatus = exchangeStatus;
	}

	@Override
	public String toString() {
		Map<String, Object> jsonMap = new HashMap<>();
		
		jsonMap.put("user_id", userId == null ? 0 : userId);
		jsonMap.put("goods_id", goodsId == null ? 0 : goodsId);
		jsonMap.put("goods_title", goodsTitle == null ? "" : goodsTitle);
		jsonMap.put("custom_goods_id", customGoodsId == null ? 0 : customGoodsId);
		jsonMap.put("exchange_code_id", exchangeCodeId == null ? 0 : exchangeCodeId);
		jsonMap.put("goods_type", goodsType == null ? 0 : goodsType);
		jsonMap.put("price", price == null ? 0 : price);
		jsonMap.put("serial_number", serialNumber == null ? "" : serialNumber);
		jsonMap.put("generate_date", generateDate == null ? 0 : generateDate);
		jsonMap.put("create_time", createTime == null ? 0 : createTime);
		jsonMap.put("exchange_status", exchangeStatus == null ? "" : exchangeStatus);
		
		return JsonUtils.obj2String(jsonMap);
	}
	
}
